package com.linkstec.oracle;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;

import org.junit.Test;
 
 
public class UtilTest {
	
	@Test
	public void myOracleUtilTest(){
		Connection connection=OracleUtil.getConnection();
		Statement stm=null;
		ResultSet rs=null;
		try {
			stm= connection.createStatement();
			String sql="select * from smot_conf";
			rs=stm.executeQuery(sql);
			while(rs.next()){
				Date REC_GEN_TIME=rs.getDate(1);
				Date REC_GEN_TIME2=rs.getDate("REC_GEN_TIME");
				Date REC_UPD_TIME=rs.getDate(2);
				String CONF_KEY=rs.getString(3);
				String CONF_VALUE=rs.getString(4);
				System.out.println("REC_GEN_TIME="+REC_GEN_TIME +"-"+REC_UPD_TIME+"-"+CONF_KEY+CONF_VALUE);
				System.out.println(REC_GEN_TIME2);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			OracleUtil.release(connection, stm, rs);
		}
		
	}
}
